const express = require('express');
const router = express.Router();
const { test } = require('../controllers/test');
const { loginWX, getUserInfo, updateUserInfo } = require('../controllers/user');
const { createPostItem, getPostItems, getPostItemById, deletePostItemById, updatePostItemStatu, getPostItemByUserId } = require('../controllers/postItem');
const { createComment, getCommentsByCommentId, getCommentsByPostId, deleteComment } = require('../controllers/comment');

// const { uploadFile } = require('../controllers/oss');
router.get('/test', test);

router.post('/wxLogin', loginWX)
router.get('/userInfo', getUserInfo)
router.post('/userInfo', updateUserInfo)

router.post('/newPost', createPostItem)
router.post('/getPostItems', getPostItems)
router.get('/getPostItemById', getPostItemById)
router.delete('/deletePostItemById', deletePostItemById)
router.post('/updatePostItemStatu', updatePostItemStatu)
router.post('/getPostItemByUserId', getPostItemByUserId)

//评论
router.post('/newComment', createComment)
router.get('/getCommentsByCommentId', getCommentsByCommentId)
router.get('/getCommentsByPostId', getCommentsByPostId)
router.delete('/deleteComment', deleteComment)

module.exports = router;
